﻿using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class OptionsMenuControl : MonoBehaviour 
{
    public Toggle OnOFF;

    private int OPT;

	// Use this for initialization
	void Start () 
    {
	    if(PlayerPrefs.HasKey("FPS"))
        {
            if (PlayerPrefs.GetInt("FPS") == 1)
                OnOFF.isOn = true;
            else
                OnOFF.isOn = false;
        }
	}
	
    public void SetFPS_Option(bool Option)
    {
        if (Option == true)
            OPT = 1;
        if (Option == false)
            OPT = 0;        

        PlayerPrefs.SetInt("FPS", OPT);

        if (OPT == 0)
            Debug.Log("Modo FPS desactivado");

        if (OPT == 1)
            Debug.Log("Modo FPS activado");
    }
}
